#include "mainwindow.h"

#include "cleaner/cleanerdbusadaptorimpl.h"
#include "cleaner/trashcleanwidget.h"

#include <QHBoxLayout>

MainWindow::MainWindow(QWidget *parent)
    : QFrame(parent),
      mTrashCleanWidget(nullptr),
      mDbusAdaptorImpl(nullptr)
{
    initUI();
    initconnect();
}

MainWindow::~MainWindow()
{

}


void MainWindow::initUI()
{
    if (!mDbusAdaptorImpl) {
        mDbusAdaptorImpl = new CleanerDBusAdaptorImpl(this);
    }
    if (!mTrashCleanWidget) {
        mTrashCleanWidget = new TrashCleanWidget(this, mDbusAdaptorImpl);
    }

    QHBoxLayout* mainLayout = new QHBoxLayout(this);
    mainLayout->setMargin(0);

    mainLayout->addWidget(mTrashCleanWidget);
}

void MainWindow::initconnect()
{

}
